package com.erclab.xpresso.reports.filters
{
	import mx.core.UIComponent;
	import flash.events.Event;
	
	import com.erclab.xpresso.formelements.TextInput;
	import mx.collections.ArrayCollection;
	import com.erclab.xpresso.reports.Report;

	public class SimpleTextFilter extends TextInput implements Filter
	{
		protected var columName:String;
		protected var theReport:Report;
		
		public function applyFilter(e:Event):void{
			var i:int = 0;
			theReport.theGrid.dataProvider = theReport.theData;
			theReport.theData.refresh();
		}
		
		public function setReport(r:Report):void{
			this.theReport = r;
			this.addEventListener(Event.CHANGE, this.applyFilter, false, 0, false); 
		}
		
		public function setColumnToFilter(column:String):void{
			this.columName = column;
		}
		
		public function getColumnToFilter():String{
			return this.columName;
		}
		
	}
}